//
//  LSZRequestTotal.m
//  JK九酷云头条
//
//  Created by 九酷 on 2017/11/6.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LSZRequestTotal.h"
#import "NSDictionary+Data.h"

@implementation LSZRequestTotal

+(void)initWithPostRequest:(NSString *)url :(NSDictionary *)dic :(HTTPPost)block
{
    NetworkTool *networkTool = [NetworkTool sharedInstance];
    NSDictionary *parameters = @{@"data":[dic getData]};
      [networkTool POSTWithUrlString:url parameters:parameters success:^(id responseObject) {
//          NSDictionary * jsonDic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
        id jsonDic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
         block(YES,@"",jsonDic);
 
    } failure:^(NSError *error) {
        [LSZSpecialPackaging Reachability:^(NSString * strMessage) {
            block(NO,strMessage,nil);
        }];
    }];
}
+(void)initWithGetRequest :(NSString *)url :(NSDictionary *)dic :(HTTPPost)block
{
    NetworkTool *networkTool = [NetworkTool sharedInstance];
    NSDictionary *parameters = @{@"data":[dic getData]};

    [networkTool GETWithUrlString:url parameters:parameters success:^(id responseObject) {
        NSDictionary * jsonDic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];
         NSLog(@"%@",jsonDic);
        
    } failure:^(NSError *error) {
        [LSZSpecialPackaging Reachability:^(NSString * strMessage) {
            block(NO,strMessage,nil);
        }];
    }];
}
@end
